package com.example.ruralservicedigitalplatform.mapper;

import com.example.ruralservicedigitalplatform.domain.po.DeliveryMan;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;

@Mapper
public interface DeliveryManMapper {
    @Select("select * from villager_platform.deliveryMan where username = #{username}")
    DeliveryMan getByName(String username);


    public List<DeliveryMan> list2(Integer deliverymanId,String name, String password,String gender,int phoneNumber,int age, String image,
                                   String idNumber,int status, double averageTime, BigDecimal totalDeliveries,BigDecimal rating,
                                  @DateTimeFormat(pattern="yyyy-MM-dd") LocalDate begin,
                                  @DateTimeFormat(pattern="yyyy-MM-dd")LocalDate end);

    void update(DeliveryMan deliveryMan);

    void delete(List<Integer> ids);

    void insert(DeliveryMan deliveryMan);
}
